package de.tum.getraenke;

public class Drink {
	private String gtin;
	private String name;
	private String packing;
	private double size;
	private double price;
	private double deposit;
	private String image;
	private long lastUpdate;
    
	public String getGtin() {
		return gtin;
	}
	public void setGtin(String gtin) {
		this.gtin = gtin;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPacking() {
		return packing;
	}
	public void setPacking(String packing) {
		this.packing = packing;
	}
	public double getSize() {
		return size;
	}
	public void setSize(double size) {
		this.size = size;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public double getDeposit() {
		return deposit;
	}
	public void setDeposit(double deposit) {
		this.deposit = deposit;
	}
	public String getImage() {
		return image;
	}
	public void setImage(String image) {
		this.image = image;
	}
	public long getLastUpdate() {
		return lastUpdate;
	}
	public void setLastUpdate(long lastUpdate) {
		this.lastUpdate = lastUpdate;
	}
	
    public String toString() {
    	return name + " (" + packing + ", " + size + ")";
    }
    
    public boolean equals(Object obj) {
    	
    	if(obj == this){
            return true;
        }
        if(obj == null || obj.getClass() != this.getClass()){
            return false;
        }
    	
        Drink other = (Drink) obj;
        
    	boolean result = gtin == other.gtin;
    	result = result && name == other.name;
    	result = result && packing == other.packing;
    	result = result && size == other.size;
    	result = result && price == other.price;
    	result = result && deposit == other.price;
    	result = result && image == other.image;
    	
    	return name.equals(other.name) && size == other.size && packing.equals(other.packing);
    }
}
